package com.cnap.model.schedule;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

/**
 * <类文件描述>
 *
 * @author xc
 **/
class StrategyStatusEnumTest {

    @Test
    void getStatusValueByMessageUnknown() {
        int s = StrategyStatusEnum.getStatusValueByMessage("12");

        Assertions.assertEquals(StrategyStatusEnum.UNKNOWN.getStatus(), s);
    }

    @Test
    void getStatusValueByMessage() {
        int s = StrategyStatusEnum.getStatusValueByMessage(StrategyStatusEnum.STARTING.getMessage());

        Assertions.assertEquals(StrategyStatusEnum.STARTING.getStatus(), s);
    }

    @Test
    void isValid() {
        boolean falseResult = StrategyStatusEnum.APPLIED.isValid("");
        Assertions.assertFalse(falseResult);

        boolean trueResult = StrategyStatusEnum.APPLIED.isValid("3");
        Assertions.assertTrue(trueResult);
    }
}